<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>正则</title>
</head>
<body>
  <input type="text" maxlength="11" id='input' oninput = "RegExpInput()" placeholder="请输入金额"/>
  <input type="text" oninput = "value=value.replace(/[^\d.]/g,'').replace(/\d{}/)" placeholder="请输入金额"/>
  <script>
    function RegExpInput() {
      var input = document.getElementById('input').value
      let value = input.replace(/[^\d.]/g,'')
      // .replace(/^0+(\d)/g,params=>{
      //   console.log('第一次匹配',params);
      // })
      // .replace(/^\./,'0.')
      // .replace(/(\d{1,8}).(\d{1,2})/g,($0,$1,$2,$3)=>{
      //   console.log('第二次匹配',$0,$1,$2,$3);
      //   return $0
      // })
      if(value.indexOf)
      document.getElementById('input').value = value
    }
    var test = '111111133.33'
    console.log('===',test.match(/(\d{1,8}).*(\d{1,2})/g));
  </script>
</body>
</html>